/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package UISUTModel.impl;

import UISUTModel.UIDataVariable;
import UISUTModel.UISUTModelPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>UI Data Variable</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link UISUTModel.impl.UIDataVariableImpl#getConstraintRE <em>Constraint RE</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class UIDataVariableImpl extends UISUTElementImpl implements UIDataVariable {
	/**
	 * The default value of the '{@link #getConstraintRE() <em>Constraint RE</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getConstraintRE()
	 * @generated
	 * @ordered
	 */
	protected static final String CONSTRAINT_RE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getConstraintRE() <em>Constraint RE</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getConstraintRE()
	 * @generated
	 * @ordered
	 */
	protected String constraintRE = CONSTRAINT_RE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected UIDataVariableImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return UISUTModelPackage.Literals.UI_DATA_VARIABLE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getConstraintRE() {
		return constraintRE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setConstraintRE(String newConstraintRE) {
		String oldConstraintRE = constraintRE;
		constraintRE = newConstraintRE;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UISUTModelPackage.UI_DATA_VARIABLE__CONSTRAINT_RE, oldConstraintRE, constraintRE));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case UISUTModelPackage.UI_DATA_VARIABLE__CONSTRAINT_RE:
				return getConstraintRE();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case UISUTModelPackage.UI_DATA_VARIABLE__CONSTRAINT_RE:
				setConstraintRE((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case UISUTModelPackage.UI_DATA_VARIABLE__CONSTRAINT_RE:
				setConstraintRE(CONSTRAINT_RE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case UISUTModelPackage.UI_DATA_VARIABLE__CONSTRAINT_RE:
				return CONSTRAINT_RE_EDEFAULT == null ? constraintRE != null : !CONSTRAINT_RE_EDEFAULT.equals(constraintRE);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (constraintRE: ");
		result.append(constraintRE);
		result.append(')');
		return result.toString();
	}

} //UIDataVariableImpl
